/**
 * Created by Administrator on 2017/3/28.
 * @description 工具类js
 */
/**深度拷贝*/
exports.extend = function(parent, child) {
    var i, proxy;
    proxy = JSON.stringify(parent); //把parent对象转换成字符串
    proxy = JSON.parse(proxy); //把字符串转换成对象，这是parent的一个副本
    child = child || {};
    for(i in proxy) {
        if(proxy.hasOwnProperty(i)) {
            child[i] = proxy[i];
        }
    }
    proxy = null; //因为proxy是中间对象，可以将它回收掉
    return child;
};

/**数组重组、方便2个一组*/
exports.arrayGroup = function (list) {
    let tmp = [];
    for(let i=0; i< (list.length/2); i++){
        let t=[];
        t.push(list[i*2]);
        if(i*2 < list.length-1) t.push(list[i*2 + 1]);
        tmp.push(t);
    }
    return tmp;
};


/**默认的站位符*/
import Placeholder from 'assets/images/midea_logo.png';
exports.placeholder = Placeholder;